#include "clientFunc.h"
// 处理rm指令的返回值
int rmProc(int sockfd, cwd_t* pcwd, cmd_t* pcmd)
{
    char pathStr[1024] = {0};
    train_t train;    
    //realServerPath(pcwd, pcmd->argv1);
    parsePath(pcwd, pcmd->argv1, pathStr);
    memset(pcmd->argv1, 0, sizeof(pcmd->argv1));
    strcpy(pcmd->argv1, pathStr);
    send(sockfd, pcmd, sizeof(cmd_t), MSG_NOSIGNAL);
    if(!recvMsg(sockfd, &train)){
        return -1;
    }
    printf("删除成功!\n");
    return 0;
}


// 处理mkdir指令的返回值
int mkdirProc(int sockfd, cwd_t* pcwd, cmd_t* pcmd){
    char pathStr[1024] = {0};
    //realServerPath(pcwd, pcmd->argv1);
    parsePath(pcwd, pcmd->argv1, pathStr);
    memset(pcmd->argv1, 0, sizeof(pcmd->argv1));
    strcpy(pcmd->argv1, pathStr);

    send(sockfd, pcmd, sizeof(cmd_t), MSG_NOSIGNAL);
    train_t train;
    if(!recvMsg(sockfd, &train)){
        return -1;
    }
    printf("创建成功!\n");
    return 0;
}

